package com.xiaoshuidi.cloud.module.member.api.coupon.vo;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Alex
 * @description 优惠券状态
 * @date 2022/12/5 16:45
 */
@Getter
@AllArgsConstructor
public enum CouponStatusOperateEnum implements IEnum<Integer> {
	//未提交 查看、编辑、删除
	NOT_SUBMITTED(1,true,true,true,false,false,false),
	//审核中 查看
	BEING_APPROVED(2,true,false,false,false,false,false),
	//审批驳回 查看、编辑、删除
	APPROVAL_REJECTION (3,true,false,true,true,true,false),
	//未开始 查看、终止
	NOT_STARTED(4,true,false,false,false,true,false),
	//进行中 查看、数据、终止
	IN_PROGRESS (5,true,false,false,true,true,false),
	//已终止 查看 数据 启动
	TERMINATED (6,true,false,false,true,true,false),
	//已结束 查看、数据
	COMPLETED (7,true,false,false,true,false,false),
	NO_PASS (8,true,false,true,true,true,false),
	CANCEL (9,true,false,true,true,true,false);
	@EnumValue
	private final Integer code;
	private Boolean vie;
	private Boolean edi;
	private Boolean del;
	private Boolean dat;
	private Boolean ter;
	private Boolean sta;
	private static Map<Integer, CouponStatusOperateEnum> enumMap = new HashMap<>();
	static {
		CouponStatusOperateEnum[] values = CouponStatusOperateEnum.values();
		for (CouponStatusOperateEnum value : values) {
			enumMap.put(value.getCode(), value);
		}
	}
	public static CouponStatusOperateEnum getEnum(Integer num){
		return enumMap.get(num);
	}
	@Override
	public Integer getValue() {
		return code;
	}


}
